﻿using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace Metro.Kashikoi.ServiceContract.Storage
{
    /// <summary>
    /// This class defines the labeled shelf.
    /// </summary>
    [DataContract(IsReference = true)]
    public class LabeledShelfContainer : Container
    {
        /// <summary>
        /// Gets or sets the label1.
        /// </summary>
        /// <value>
        /// The label1.
        /// </value>
        [DataMember]
        [Required]
        [StringLength(255, MinimumLength = 1)]
        [StringLengthValidator(1, 255)]
        public string Label1 { get; set; }

        /// <summary>
        /// Gets or sets the label2.
        /// </summary>
        /// <value>
        /// The label2.
        /// </value>
        [DataMember]
        [Required]
        [StringLength(255, MinimumLength = 1)]
        [StringLengthValidator(1, 255)]
        public string Label2 { get; set; }

        /// <summary>
        /// Gets or sets the label3.
        /// </summary>
        /// <value>
        /// The label3.
        /// </value>
        [DataMember]
        [Required]
        [StringLength(255, MinimumLength = 1)]
        [StringLengthValidator(1, 255)]
        public string Label3 { get; set; }

        /// <summary>
        /// Copies the specified to the destination.
        /// </summary>
        /// <param name="destination">The destination.</param>
        public void CopyTo(LabeledShelfContainer destination)
        {
            destination.Label1 = this.Label1;
            destination.Label2 = this.Label2;
            destination.Label3 = this.Label3;
        }

        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>The newly created instance.</returns>
        public LabeledShelfContainer Clone()
        {
            var container = new LabeledShelfContainer();
            this.CopyTo(container);
            return container;
        }
    }
}
